<?php

namespace App\Library\Junda\src;

use App\Library\Junda\JunDaApiClient;

class Consumption
{

    /**
     *  使用水卡
     *  下发指定终端IC卡的线上消费 01
     * @param $eqid
     * @return mixed
     */
    public static function VirtulCardConsume($equipment_id,$cardNo)
    {
        $url = "https://apiv2.ljda.net/api/VirtulCardConsume";
        $response = JunDaApiClient::sendRequest($url,'GET',['equipment_id'=>$equipment_id,'cardNo'=>$cardNo]);
        return $response;
    }
    /**
     *
     *  下发终端第三方消费 01
     * @param $eqid
     * @return mixed
     */
    public static function IssueOnlineConsume($equipment_id,$money,$orderNo)
    {
        $url = "https://apiv2.ljda.net/api/IssueOnlineConsume";
        $response = JunDaApiClient::sendRequest($url,'GET',['equipment_id'=>$equipment_id,'money'=>$money,'orderNo'=>$orderNo]);
        return $response;
    }

    public static function GetPayConsumeByOrderNo($OrderNo)
    {
        $url = "https://apiv2.ljda.net/api/GetPayConsumeByOrderNo";
        $response = JunDaApiClient::sendRequest($url,'POST',json_encode(['OrderNo'=>$OrderNo]));
        return $response;
    }
}
